package decorators;

import javax.annotation.Priority;
import javax.decorator.Decorator;
import javax.decorator.Delegate;
import javax.inject.Inject;
import javax.interceptor.Interceptor;

import logger.Logger;
import logger.LoggerComCDI;

@Decorator
@Priority(Interceptor.Priority.APPLICATION)
public class LoggerDecorator implements Logger {

	@Inject
	@Delegate
	LoggerComCDI delegate;

	@Override
	public void gravar(String mensagem) {
		System.out.println("Mensagem recebida: " + mensagem);
		delegate.gravar(mensagem);
	}

}
